package com.sharding.shardingdemo.handler;

import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;

import java.util.Collection;
//
//public final class ApacheShardingTable implements PreciseShardingAlgorithm<Long> {
//    @Override
//    public String doSharding(final Collection<String> tableNames, final PreciseShardingValue<Long> shardingValue) {
//        for (String table : tableNames) {
//            if (table.endsWith(shardingValue.getValue() % 2 + "")) {
//                System.out.println("表:" + table);
//                return table;
//            }
//        }
//        throw new UnsupportedOperationException();
//    }
//}
